package com.cxg.fairy.ec.main.personal.message;

import android.os.Bundle;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.SimpleClickListener;
import com.cxg.fairy.delegates.LatteDelegate;
import com.cxg.fairy.ec.main.personal.list.ListBean;
import com.cxg.fairy.ui.recycler.MultipleFields;
import com.cxg.fairy.ui.recycler.MultipleItemEntity;

/**
 * Created by CFairy
 */

public class MessageCenterClickListener extends SimpleClickListener {

    private final LatteDelegate DELEGATE;

    public MessageCenterClickListener(LatteDelegate delegate) {
        this.DELEGATE = delegate;
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
        final MultipleItemEntity entity = (MultipleItemEntity) baseQuickAdapter.getData().get(position);
        Bundle args = new Bundle();
        int id = entity.getField(MultipleFields.ID);
        LatteDelegate delegate = new MessageCenterFundsDelegate();
        switch (id) {
            case 1:
                args.putInt("id", 1);
                break;
            case 2:
                args.putInt("id", 2);
                break;
            case 3:
                args.putInt("id", 3);
                break;
            case 4:
                args.putInt("id", 4);
                break;
            default:
                break;
        }
        delegate.setArguments(args);
        DELEGATE.getSupportDelegate().start(delegate);
    }

    @Override
    public void onItemLongClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {

    }
}
